#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;

class Author
{
	friend ostream& operator<<(ostream&, const Author&);
public:
	Author();
	Author(string&);
	Author operator=(Author &a);
	string getAuthor() const;
	void mutateAuthor(string &);
private:
	string fname, lname;
};

ostream& operator<<(ostream& os, const Author& a)
{
	os << a.fname << " " << a.lname << endl;
	return os;
}

Author::Author()
	: fname("First"), lname("Commit")
{

}

Author::Author(string &s)
{
	int pos = s.find(' ');
	fname = s.substr(0,pos);
	lname = s.substr(pos+1);
}

Author Author::operator=(Author &a)
{
	return Author(a.getAuthor());
}

string Author::getAuthor() const
{
	return fname + " " + lname;
}

void Author::mutateAuthor(string &s)
{
	int pos = s.find(' ');
	fname = s.substr(0,pos);
	lname = s.substr(pos+1);
}

class Book
{
	friend ostream& operator<<(ostream&, const Book&);
public:
	Book();
	Book(Author&);
	void mutator( string[] );
private:
	string title;
	Author author;
	float price;
	int onHand;
	int qtySold;
	string isbn;
	float revenue;
};

ostream& operator<<(ostream &os, const Book &b)
{
	os << b.title << endl;
	os << b.author << endl;
	return os;
}

Book::Book()
{
	title = "Default Constructor Book";
	string auth = "Default Constructor Author";
	author.mutateAuthor(auth);
	price = 0.0;
	onHand = 0;
	qtySold = 0;
	isbn ="123-332-23-432";
	revenue = (float)price*qtySold;
}


int main()
{
	string name = "Liam Fitzpatrick";
	Author a;
	a = Author(name);
	cout << a.getAuthor() << endl;

	Book b;
	cout << b << endl;

	return 0;
}